

Ext.define('pf.dashboard.DashboardDataView', {
    extend: 'Ext.view.View',
    store: Ext.create('pf.dashboard.DashboardStore'),
    tpl: Ext.create('Ext.XTemplate', 
        '<table class="dashboard-table">',   
            '<tr>',
                '<tpl for=".">',
                    '<td><div class="item-wrap"><span>{text}</span></div></td>',
                    '<tpl if="xindex % 3 === 0 && xindex != xcount">',
                        '</tr><tr>',
                    '</tpl>',
                '</tpl>',
            '</tr>',
        '</table>',
        {
          compiled:true
        }
    ),
    multiSelector: true,
    itemSelector: 'div.item-wrap',
    overCls: 'dashboard-item-over',
    listeners: {
        selectionchange: function(view, selections, options) {
            pf.util.MessageBus.fireEvent('switchview', 'contentCards');
            pf.util.MessageBus.fireEvent('switchcard', selections[0].data.id);
        }
    }
});